package com.douqu.game.core.entity.world.map;

import com.bean.core.buffer.ByteBuffer;
import com.douqu.game.core.e.E_CityDropBelong_Status;
import com.douqu.game.core.entity.EntityObject;

/**
 * @author: Gavin.
 * Description:
 * Date: 2018/7/4 0004 下午 2:38
 * Huan Yu Copyright (c) 2017 All Rights Reserved.
 */
public class CityDropBean extends EntityObject{

    /** 掉落奖励情况ID */
    private int rewardId;

    /** 掉落组ID */
    private int dropGroup;

    /** 掉落时间 */
    private long dropTime;

    /** 奖励归属阵营 如果是世界级的传入0 玩家级的传入玩家的阵营 */
    private int camp;
    public CityDropBean(){

    }

    public CityDropBean(int rewardId,int dropGroup,long dropTime,int camp){
        init(rewardId,dropGroup,dropTime,camp);
    }

    public void init(int rewardId,int dropGroup,long dropTime,int camp){
        this.rewardId = rewardId;
        this.dropGroup = dropGroup;
        this.dropTime = dropTime;
        this.camp = camp;
    }

    public void init(){
        rewardId = 0;
        dropGroup = 0;
        dropTime = 0;
        camp = 0;
    }

    public void loadFrom(ByteBuffer buffer){
        rewardId = buffer.readInt();
        dropGroup = buffer.readByte();
        dropTime = buffer.readLong();
        camp = buffer.readByte();
    }

    public void writeTo(ByteBuffer buffer){
        buffer.writeInt(rewardId);
        buffer.writeByte(dropGroup);
        buffer.writeLong(dropTime);
        buffer.writeByte(camp);
    }

    public int getRewardId() {
        return rewardId;
    }

    public void setRewardId(int rewardId) {
        this.rewardId = rewardId;
    }

    public int getDropGroup() {
        return dropGroup;
    }

    public void setDropGroup(int dropGroup) {
        this.dropGroup = dropGroup;
    }

    public long getDropTime() {
        return dropTime;
    }

    public void setDropTime(long dropTime) {
        this.dropTime = dropTime;
    }

    public int getCamp() {
        return camp;
    }

    public void setCamp(int camp) {
        this.camp = camp;
    }

}
